#!/data/data/com.termux/files/usr/bin/bash
#本地文件
#/sdcard/git/git_readme
#远程仓库
#bmsh-shell bmsh-patch bmsh-mods0 bmsh-mods1 bmsh-mods2 bmsh-mods

#手动输入仓库名称
echo "请输入仓库名称："
read LIST

#参考资料
#echo $(echo 11 13)
#11 13
#echo $(seq 11 13)
#11 12 13
if test -z $PID ; then
	#自动生成LIST
	LIST=$(echo bunnyman bmsh-shell bmsh-patch bmsh-mods0 bmsh-mods1 bmsh-mods2 bmsh-mods3)
fi

#批处理开始
for GNAME in $LIST;do
	#清屏
	clear
	#  #  #  #  #  #  #  #  #  #
	#git工作目录
	cd /sdcard/git/
	#删除本地仓库
	rm -rf $GNAME
	#下载远程仓库
	git clone --depth=1 "https://gitee.com/bunnyman/$GNAME.git"
	#进入仓库目录
	cd $GNAME
	#  #  #  #  #  #  #  #  #  #
	#修改README
	cp -r /sdcard/git/git_readme README.md
	#  #  #  #  #  #  #  #  #  #
	#提交修改到git
	git add *
	git commit -m "批处理修改README"
	git push -u origin master
	#  #  #  #  #  #  #  #  #  #
	#git工作目录
	cd /sdcard/git/
	#删除本地仓库
	#rm -rf $GNAME
done


